import { createRouter, createWebHistory } from "vue-router";
const routes = [
  {
    path: "/admin",
    name: "layout",
    component: () => import("../views/layout.vue"),
    redirect: "/admin/goods",
    children: [
      {
        path: "goods",
        name: "goods",
        component: () => import("../views/Goods.vue"),
      },
    ],
  },
  {
    path: "/",
    name: "home",
    component: () => import("../views/Home.vue"),
    redirect: "/index",
    children: [
      {
        path: "index",
        name: "index",
        component: () => import("../views/index.vue"),
      },
      {
        path: "detail",
        name: "detail",
        component: () => import("../views/detail.vue"),
      },
      {
        path: "selgoods",
        name: "selgoods",
        component: () => import("../views/selgoods.vue"),
      },
    ],
  },
  {
    path: "/login",
    name: "Login",
    component: () => import("../views/Login.vue"),
  },
];

export default createRouter({
  history: createWebHistory(),
  routes,
});
